#include <iostream>
#include <memory>
using std::cout;
using std::endl;
using std::auto_ptr;

void test0(){
    int* pInt = new int(10);
    auto_ptr<int> ap(pInt);
    cout << *ap << endl;
    cout << *pInt << endl;

    cout << &ap << endl;
    cout << &pInt << endl;
}

void test1(){
    auto_ptr<int> ap(new int(100));
    cout << *ap << endl;

    auto_ptr<int> ap1(ap);
    cout << *ap1 << endl;
    cout << *ap << endl;
}

int main(int argc, char * argv[])
{
    test0();
    return 0;
}


